/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Vue;

import Modele.Dico;

/**
 *
 * @author michaelrepiso
 */
public class Vue extends javax.swing.JFrame {
    private Dico dico;
    private int start;

    /**
     * Creates new form Vue
     */
    public Vue(Dico dico) {
        this.dico = dico;
        initComponents();
        this.start = 0;
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Haut = new javax.swing.JPanel();
        CallPutFlag = new javax.swing.JLabel();
        S = new javax.swing.JLabel();
        X = new javax.swing.JLabel();
        T = new javax.swing.JLabel();
        r = new javax.swing.JLabel();
        b = new javax.swing.JLabel();
        v = new javax.swing.JLabel();
        nSteps = new javax.swing.JLabel();
        nSimulations = new javax.swing.JLabel();
        CBCallPutFlag = new javax.swing.JComboBox();
        CBS = new javax.swing.JComboBox();
        CBX = new javax.swing.JComboBox();
        CBT = new javax.swing.JComboBox();
        CBr = new javax.swing.JComboBox();
        CBb = new javax.swing.JComboBox();
        CBv = new javax.swing.JComboBox();
        CBnSteps = new javax.swing.JComboBox();
        CBnSimulations = new javax.swing.JComboBox();
        Milieu = new javax.swing.JPanel();
        SingleThreaded = new javax.swing.JToggleButton();
        MultiThreaded = new javax.swing.JToggleButton();
        ProgressBar = new javax.swing.JProgressBar(0,100);
        Bas = new javax.swing.JPanel();
        PanelResult = new javax.swing.JPanel();
        LabelResult = new javax.swing.JLabel();
        result = new javax.swing.JLabel();
        PanelTime = new javax.swing.JPanel();
        LabelTime = new javax.swing.JLabel();
        time = new javax.swing.JLabel();
        PanelButtonStart = new javax.swing.JPanel();
        StartButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.Y_AXIS));

        Haut.setLayout(new java.awt.GridLayout(2, 9));

        CallPutFlag.setText("CallPutFlag");
        Haut.add(CallPutFlag);

        S.setText("S");
        Haut.add(S);

        X.setText("X");
        Haut.add(X);

        T.setText("T");
        Haut.add(T);

        r.setText("r");
        Haut.add(r);

        b.setText("b");
        b.setToolTipText("");
        Haut.add(b);

        v.setText("v");
        Haut.add(v);

        nSteps.setText("nSteps");
        Haut.add(nSteps);

        nSimulations.setText("nSimulations");
        Haut.add(nSimulations);

        for(String elt : dico.getListCallPutFlag()){
            CBCallPutFlag.addItem(elt);
        }
        CBCallPutFlag.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CBCallPutFlagActionPerformed(evt);
            }
        });
        Haut.add(CBCallPutFlag);

        for(Double elt : dico.getListS()){
            CBS.addItem(elt);
        }
        CBS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CBSActionPerformed(evt);
            }
        });
        Haut.add(CBS);

        for(Double elt : dico.getListX()){
            CBX.addItem(elt);
        }
        Haut.add(CBX);

        for(Double elt : dico.getListT()){
            CBT.addItem(elt);
        }
        Haut.add(CBT);

        for(Double elt : dico.getListr()){
            CBr.addItem(elt);
        }
        Haut.add(CBr);

        for(Double elt : dico.getListb()){
            CBb.addItem(elt);
        }
        Haut.add(CBb);

        for(Double elt : dico.getListv()){
            CBv.addItem(elt);
        }
        Haut.add(CBv);

        for(Integer elt : dico.getListnSteps()){
            CBnSteps.addItem(elt);
        }
        Haut.add(CBnSteps);

        for(Integer elt : dico.getListnSimulations()){
            CBnSimulations.addItem(elt);
        }
        Haut.add(CBnSimulations);

        getContentPane().add(Haut);

        Milieu.setLayout(new java.awt.BorderLayout());

        SingleThreaded.setSelected(true);
        SingleThreaded.setText("SingleThreaded");
        SingleThreaded.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SingleThreadedActionPerformed(evt);
            }
        });
        Milieu.add(SingleThreaded, java.awt.BorderLayout.WEST);

        MultiThreaded.setText("MultiThreaded");
        MultiThreaded.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MultiThreadedActionPerformed(evt);
            }
        });
        Milieu.add(MultiThreaded, java.awt.BorderLayout.EAST);
        Milieu.add(ProgressBar, java.awt.BorderLayout.SOUTH);

        getContentPane().add(Milieu);

        Bas.setLayout(new javax.swing.BoxLayout(Bas, javax.swing.BoxLayout.X_AXIS));

        LabelResult.setText("Result");
        PanelResult.add(LabelResult);
        PanelResult.add(result);

        Bas.add(PanelResult);

        LabelTime.setText("Time");
        PanelTime.add(LabelTime);
        PanelTime.add(time);

        Bas.add(PanelTime);

        getContentPane().add(Bas);

        StartButton.setText("Start");
        StartButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                StartButtonActionPerformed(evt);
            }
        });
        PanelButtonStart.add(StartButton);

        getContentPane().add(PanelButtonStart);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void CBCallPutFlagActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CBCallPutFlagActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_CBCallPutFlagActionPerformed

    private void CBSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CBSActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_CBSActionPerformed

    private void StartButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_StartButtonActionPerformed
        this.setStart(1);
    }//GEN-LAST:event_StartButtonActionPerformed

    private void SingleThreadedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SingleThreadedActionPerformed
        this.MultiThreaded.setSelected(false);
    }//GEN-LAST:event_SingleThreadedActionPerformed

    private void MultiThreadedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MultiThreadedActionPerformed
        this.SingleThreaded.setSelected(false);
    }//GEN-LAST:event_MultiThreadedActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Vue.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Vue.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Vue.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Vue.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                //new Vue(dico).setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel Bas;
    private javax.swing.JComboBox CBCallPutFlag;
    private javax.swing.JComboBox CBS;
    private javax.swing.JComboBox CBT;
    private javax.swing.JComboBox CBX;
    private javax.swing.JComboBox CBb;
    private javax.swing.JComboBox CBnSimulations;
    private javax.swing.JComboBox CBnSteps;
    private javax.swing.JComboBox CBr;
    private javax.swing.JComboBox CBv;
    private javax.swing.JLabel CallPutFlag;
    private javax.swing.JPanel Haut;
    private javax.swing.JLabel LabelResult;
    private javax.swing.JLabel LabelTime;
    private javax.swing.JPanel Milieu;
    private javax.swing.JToggleButton MultiThreaded;
    private javax.swing.JPanel PanelButtonStart;
    private javax.swing.JPanel PanelResult;
    private javax.swing.JPanel PanelTime;
    public static javax.swing.JProgressBar ProgressBar;
    private javax.swing.JLabel S;
    private javax.swing.JToggleButton SingleThreaded;
    private javax.swing.JButton StartButton;
    private javax.swing.JLabel T;
    private javax.swing.JLabel X;
    private javax.swing.JLabel b;
    private javax.swing.JLabel nSimulations;
    private javax.swing.JLabel nSteps;
    private javax.swing.JLabel r;
    private javax.swing.JLabel result;
    private javax.swing.JLabel time;
    private javax.swing.JLabel v;
    // End of variables declaration//GEN-END:variables

    
    /**
     * @return the dico
     */
    public Dico getDico() {
        return dico;
    }

    /**
     * @param dico the dico to set
     */
    public void setDico(Dico dico) {
        this.dico = dico;
    }

    /**
     * @return the Bas
     */
    public javax.swing.JPanel getBas() {
        return Bas;
    }

    /**
     * @param Bas the Bas to set
     */
    public void setBas(javax.swing.JPanel Bas) {
        this.Bas = Bas;
    }

    /**
     * @return the CBCallPutFlag
     */
    public javax.swing.JComboBox getCBCallPutFlag() {
        return CBCallPutFlag;
    }

    /**
     * @param CBCallPutFlag the CBCallPutFlag to set
     */
    public void setCBCallPutFlag(javax.swing.JComboBox CBCallPutFlag) {
        this.CBCallPutFlag = CBCallPutFlag;
    }

    /**
     * @return the CBS
     */
    public javax.swing.JComboBox getCBS() {
        return CBS;
    }

    /**
     * @param CBS the CBS to set
     */
    public void setCBS(javax.swing.JComboBox CBS) {
        this.CBS = CBS;
    }

    /**
     * @return the CBT
     */
    public javax.swing.JComboBox getCBT() {
        return CBT;
    }

    /**
     * @param CBT the CBT to set
     */
    public void setCBT(javax.swing.JComboBox CBT) {
        this.CBT = CBT;
    }

    /**
     * @return the CBX
     */
    public javax.swing.JComboBox getCBX() {
        return CBX;
    }

    /**
     * @param CBX the CBX to set
     */
    public void setCBX(javax.swing.JComboBox CBX) {
        this.CBX = CBX;
    }

    /**
     * @return the CBb
     */
    public javax.swing.JComboBox getCBb() {
        return CBb;
    }

    /**
     * @param CBb the CBb to set
     */
    public void setCBb(javax.swing.JComboBox CBb) {
        this.CBb = CBb;
    }

    /**
     * @return the CBnSimulations
     */
    public javax.swing.JComboBox getCBnSimulations() {
        return CBnSimulations;
    }

    /**
     * @param CBnSimulations the CBnSimulations to set
     */
    public void setCBnSimulations(javax.swing.JComboBox CBnSimulations) {
        this.CBnSimulations = CBnSimulations;
    }

    /**
     * @return the CBnSteps
     */
    public javax.swing.JComboBox getCBnSteps() {
        return CBnSteps;
    }

    /**
     * @param CBnSteps the CBnSteps to set
     */
    public void setCBnSteps(javax.swing.JComboBox CBnSteps) {
        this.CBnSteps = CBnSteps;
    }

    /**
     * @return the CBr
     */
    public javax.swing.JComboBox getCBr() {
        return CBr;
    }

    /**
     * @param CBr the CBr to set
     */
    public void setCBr(javax.swing.JComboBox CBr) {
        this.CBr = CBr;
    }

    /**
     * @return the CBv
     */
    public javax.swing.JComboBox getCBv() {
        return CBv;
    }

    /**
     * @param CBv the CBv to set
     */
    public void setCBv(javax.swing.JComboBox CBv) {
        this.CBv = CBv;
    }

    /**
     * @return the CallPutFlag
     */
    public javax.swing.JLabel getCallPutFlag() {
        return CallPutFlag;
    }

    /**
     * @param CallPutFlag the CallPutFlag to set
     */
    public void setCallPutFlag(javax.swing.JLabel CallPutFlag) {
        this.CallPutFlag = CallPutFlag;
    }

    /**
     * @return the Haut
     */
    public javax.swing.JPanel getHaut() {
        return Haut;
    }

    /**
     * @param Haut the Haut to set
     */
    public void setHaut(javax.swing.JPanel Haut) {
        this.Haut = Haut;
    }

    /**
     * @return the LabelResult
     */
    public javax.swing.JLabel getLabelResult() {
        return LabelResult;
    }

    /**
     * @param LabelResult the LabelResult to set
     */
    public void setLabelResult(javax.swing.JLabel LabelResult) {
        this.LabelResult = LabelResult;
    }

    /**
     * @return the LabelTime
     */
    public javax.swing.JLabel getLabelTime() {
        return LabelTime;
    }

    /**
     * @param LabelTime the LabelTime to set
     */
    public void setLabelTime(javax.swing.JLabel LabelTime) {
        this.LabelTime = LabelTime;
    }

    /**
     * @return the Milieu
     */
    public javax.swing.JPanel getMilieu() {
        return Milieu;
    }

    /**
     * @param Milieu the Milieu to set
     */
    public void setMilieu(javax.swing.JPanel Milieu) {
        this.Milieu = Milieu;
    }

    /**
     * @return the MultiThreaded
     */
    public javax.swing.JToggleButton getMultiThreaded() {
        return MultiThreaded;
    }

    /**
     * @param MultiThreaded the MultiThreaded to set
     */
    public void setMultiThreaded(javax.swing.JToggleButton MultiThreaded) {
        this.MultiThreaded = MultiThreaded;
    }

    /**
     * @return the PanelButtonStart
     */
    public javax.swing.JPanel getPanelButtonStart() {
        return PanelButtonStart;
    }

    /**
     * @param PanelButtonStart the PanelButtonStart to set
     */
    public void setPanelButtonStart(javax.swing.JPanel PanelButtonStart) {
        this.PanelButtonStart = PanelButtonStart;
    }

    /**
     * @return the PanelResult
     */
    public javax.swing.JPanel getPanelResult() {
        return PanelResult;
    }

    /**
     * @param PanelResult the PanelResult to set
     */
    public void setPanelResult(javax.swing.JPanel PanelResult) {
        this.PanelResult = PanelResult;
    }

    /**
     * @return the PanelTime
     */
    public javax.swing.JPanel getPanelTime() {
        return PanelTime;
    }

    /**
     * @param PanelTime the PanelTime to set
     */
    public void setPanelTime(javax.swing.JPanel PanelTime) {
        this.PanelTime = PanelTime;
    }


    /**
     * @return the S
     */
    public javax.swing.JLabel getS() {
        return S;
    }

    /**
     * @param S the S to set
     */
    public void setS(javax.swing.JLabel S) {
        this.S = S;
    }

    /**
     * @return the SingleThreaded
     */
    public javax.swing.JToggleButton getSingleThreaded() {
        return SingleThreaded;
    }

    /**
     * @param SingleThreaded the SingleThreaded to set
     */
    public void setSingleThreaded(javax.swing.JToggleButton SingleThreaded) {
        this.SingleThreaded = SingleThreaded;
    }

    /**
     * @return the StartButton
     */
    public javax.swing.JButton getStartButton() {
        return StartButton;
    }

    /**
     * @param StartButton the StartButton to set
     */
    public void setStartButton(javax.swing.JButton StartButton) {
        this.StartButton = StartButton;
    }

    /**
     * @return the T
     */
    public javax.swing.JLabel getT() {
        return T;
    }

    /**
     * @param T the T to set
     */
    public void setT(javax.swing.JLabel T) {
        this.T = T;
    }


    /**
     * @param X the X to set
     */
    public void setX(javax.swing.JLabel X) {
        this.X = X;
    }

    /**
     * @return the b
     */
    public javax.swing.JLabel getB() {
        return b;
    }

    /**
     * @param b the b to set
     */
    public void setB(javax.swing.JLabel b) {
        this.b = b;
    }

    /**
     * @return the nSimulations
     */
    public javax.swing.JLabel getnSimulations() {
        return nSimulations;
    }

    /**
     * @param nSimulations the nSimulations to set
     */
    public void setnSimulations(javax.swing.JLabel nSimulations) {
        this.nSimulations = nSimulations;
    }

    /**
     * @return the nSteps
     */
    public javax.swing.JLabel getnSteps() {
        return nSteps;
    }

    /**
     * @param nSteps the nSteps to set
     */
    public void setnSteps(javax.swing.JLabel nSteps) {
        this.nSteps = nSteps;
    }

    /**
     * @return the r
     */
    public javax.swing.JLabel getR() {
        return r;
    }

    /**
     * @param r the r to set
     */
    public void setR(javax.swing.JLabel r) {
        this.r = r;
    }

    /**
     * @return the resull
     */
    public javax.swing.JLabel getResult() {
        return result;
    }

    /**
     * @param resull the resull to set
     */
    public void setResull(javax.swing.JLabel resull) {
        this.result = resull;
    }

    /**
     * @return the time
     */
    public javax.swing.JLabel getTime() {
        return time;
    }

    /**
     * @param time the time to set
     */
    public void setTime(javax.swing.JLabel time) {
        this.time = time;
    }

    /**
     * @return the v
     */
    public javax.swing.JLabel getV() {
        return v;
    }

    /**
     * @param v the v to set
     */
    public void setV(javax.swing.JLabel v) {
        this.v = v;
    }

    /**
     * @return the start
     */
    public int getStart() {
        return start;
    }

    /**
     * @param start the start to set
     */
    public void setStart(int start) {
        this.start = start;
    }

    /**
     * @return the ProgressBar
     */
    public javax.swing.JProgressBar getProgressBar() {
        return ProgressBar;
    }

    /**
     * @param ProgressBar the ProgressBar to set
     */
    public void setProgressBar(javax.swing.JProgressBar ProgressBar) {
        this.ProgressBar = ProgressBar;
    }
}
